<template>
  <t-button @click="openLoading">打开全屏加载</t-button>
  <t-button @click="openLoadingWithCustomizations">自定义加载</t-button>
</template>

<script setup>
import { TLoading } from '@MEE/components'

const openLoading = () => {
  const loadingInstance = TLoading.service({
    text: '正在拼命加载中...'
  })
  setTimeout(() => {
    loadingInstance.close()
  }, 2000)
}

const openLoadingWithCustomizations = () => {
  const loadingInstance = TLoading.service({
    text: '自定义背景和文本',
    background: 'rgba(0, 0, 0, 0.7)'
  })
  setTimeout(() => {
    loadingInstance.close()
  }, 2000)
}
</script>
